#[doc = "Register `interrupt_clear` writer"]
pub struct W(crate::W<INTERRUPT_CLEAR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<INTERRUPT_CLEAR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl core::convert::From<crate::W<INTERRUPT_CLEAR_SPEC>> for W {
    fn from(writer: crate::W<INTERRUPT_CLEAR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Fields `gpio(0-15)` writer - "]
pub struct GPIO_W<'a> {
    w: &'a mut W,
    offset: usize,
}
impl<'a> GPIO_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits =
            (self.w.bits & !(0x01 << self.offset)) | (((value as u32) & 0x01) << self.offset);
        self.w
    }
}
impl W {
    #[doc = ""]
    #[inline(always)]
    pub unsafe fn gpio(&mut self, n: usize) -> GPIO_W {
        GPIO_W { w: self, offset: n }
    }
    #[doc = "Bit 0"]
    #[inline(always)]
    pub fn gpio0(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 0 }
    }
    #[doc = "Bit 1"]
    #[inline(always)]
    pub fn gpio1(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 1 }
    }
    #[doc = "Bit 2"]
    #[inline(always)]
    pub fn gpio2(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 2 }
    }
    #[doc = "Bit 3"]
    #[inline(always)]
    pub fn gpio3(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 3 }
    }
    #[doc = "Bit 4"]
    #[inline(always)]
    pub fn gpio4(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 4 }
    }
    #[doc = "Bit 5"]
    #[inline(always)]
    pub fn gpio5(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 5 }
    }
    #[doc = "Bit 6"]
    #[inline(always)]
    pub fn gpio6(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 6 }
    }
    #[doc = "Bit 7"]
    #[inline(always)]
    pub fn gpio7(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 7 }
    }
    #[doc = "Bit 8"]
    #[inline(always)]
    pub fn gpio8(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 8 }
    }
    #[doc = "Bit 9"]
    #[inline(always)]
    pub fn gpio9(&mut self) -> GPIO_W {
        GPIO_W { w: self, offset: 9 }
    }
    #[doc = "Bit 10"]
    #[inline(always)]
    pub fn gpio10(&mut self) -> GPIO_W {
        GPIO_W {
            w: self,
            offset: 10,
        }
    }
    #[doc = "Bit 11"]
    #[inline(always)]
    pub fn gpio11(&mut self) -> GPIO_W {
        GPIO_W {
            w: self,
            offset: 11,
        }
    }
    #[doc = "Bit 12"]
    #[inline(always)]
    pub fn gpio12(&mut self) -> GPIO_W {
        GPIO_W {
            w: self,
            offset: 12,
        }
    }
    #[doc = "Bit 13"]
    #[inline(always)]
    pub fn gpio13(&mut self) -> GPIO_W {
        GPIO_W {
            w: self,
            offset: 13,
        }
    }
    #[doc = "Bit 14"]
    #[inline(always)]
    pub fn gpio14(&mut self) -> GPIO_W {
        GPIO_W {
            w: self,
            offset: 14,
        }
    }
    #[doc = "Bit 15"]
    #[inline(always)]
    pub fn gpio15(&mut self) -> GPIO_W {
        GPIO_W {
            w: self,
            offset: 15,
        }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Raw interrupt status registers\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [interrupt_clear](index.html) module"]
pub struct INTERRUPT_CLEAR_SPEC;
impl crate::RegisterSpec for INTERRUPT_CLEAR_SPEC {
    type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [interrupt_clear::W](W) writer structure"]
impl crate::Writable for INTERRUPT_CLEAR_SPEC {
    type Writer = W;
}
